/**
 * 
 */
package edu.umd.clip.smoothing;

/**
 * @author Denis Filimonov <den@cs.umd.edu>
 *
 */
public class SmootherProducer {
	private static final int NR_COUNTS = 10;
	private int[] counts;
	private long totalCount;
	private final int minCount;
	
	public SmootherProducer() {
		this(1);
	}
	
	public SmootherProducer(int minCount) {
		this.minCount = minCount;
		counts = new int[NR_COUNTS];
		totalCount = 0;
	}
	
	public void addCount(int count) {
		if (count >= minCount) {
			totalCount += count;
		}
		if (count >= counts.length) {
			counts[counts.length-1]++;
		} else {
			counts[count]++;
		}
	}

	/**
	 * @return Kneser-Ney Smoother
	 */
	public Smoother getKNSmoother() {
		return new KNSmoother(this);
	}
	
	/**
	 * @return Modified Kneser-Key Smoother
	 */
	public Smoother getKNModSmoother() {
		return new KNModSmoother(this);
	}
	
	/**
	 * @return Witten-Bell Smoother
	 */
	public Smoother getWBSmoother() {
		return new WBSmoother(this);
	}
	
	public Smoother getDummySmoother() {
		return new DummySmoother(this);
	}
	
	/**
	 * @return the counts
	 */
	public int[] getCounts() {
		return counts;
	}

	/**
	 * @return the totalCount
	 */
	public long getTotalCount() {
		return totalCount;
	}

	public int getMinCount() {
		return minCount;
	}
	
}
